//
//  ChildController05.m
//  PosApp
//
//  Created by 刘萍 on 2018/9/27.
//  Copyright © 2018年 李英新. All rights reserved.
//

#import "ChildController05.h"

@interface ChildController05 ()
@property (weak, nonatomic) IBOutlet UIView *BackView;
@property (weak, nonatomic) IBOutlet UITextField *NumbText;
@property (weak, nonatomic) IBOutlet UIButton *DisMissBtn;
@property (weak, nonatomic) IBOutlet UIButton *TureBtn;

@end

@implementation ChildController05

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    self.BackView.layer.cornerRadius = 8;
    self.BackView.layer.masksToBounds = YES;
    self.DisMissBtn.layer.cornerRadius = 4;
    self.DisMissBtn.layer.masksToBounds = YES;
    self.TureBtn.layer.cornerRadius = 4;
    self.TureBtn.layer.masksToBounds = YES;
    
    self.NumbText.layer.borderWidth = 1;
    self.NumbText.layer.borderColor = KRGBColor(184, 184, 184).CGColor;
    
    
}
- (IBAction)UpLoadDataOfTheController:(id)sender {
    
    NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
    [dic setObject:KUseriPhone forKey:@"phone"];
    [dic setObject:self.POSID forKey:@"pos_id"];
    [dic setObject:self.NumbText.text forKey:@"goal"];

    [MainObjectWay PostWithMethod:@"change" andAction:@"Mypos" andAddParam:YES parameters:dic success:^(id responseObject) {
        NSLog(@"请求的信息 = %@",responseObject);
        if ([MainObjectWay IsSucceedWithCode:responseObject[@"code"]]) {
            [self dismissViewControllerAnimated:YES completion:^{
                if (self.delegate) {
                    [self.delegate ChangePosTypeToUpLoadData];
                }
            }];
            
        }
    } failure:^(NSError *error) {
        NSLog(@"错误信息 = %@",error);
    }];
    
    
    
}
- (IBAction)DisMissTheController:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
